package com.feng.usercenter.common;


import com.feng.usercenter.constant.BaseConst;

import static com.feng.usercenter.constant.BaseConst.NULL_ERROR_MSG;

/**
 * 错误码
 */
public enum ErrorCode {

    SUCCESS(BaseConst.SUCCESS, BaseConst.SUCCESS_MSG, ""),
    PARAMS_ERROR(BaseConst.PARAMS_ERROR, BaseConst.PARAMS_ERROR_MSG, ""),
    NULL_ERROR(BaseConst.NULL_ERROR, NULL_ERROR_MSG, ""),

    NOT_LOGIN(BaseConst.NOT_LOGIN, BaseConst.NOT_LOGIN_MSG, ""),
    NO_AUTH(BaseConst.NO_AUTH, BaseConst.NO_AUTH_MSG, ""),
    SYSTEM_ERROR(50000, "系统异常", "");

    /**
     * 状态码
     */
    private final int code;

    /**
     * 信息描述
     */
    private final String message;

    /**
     * 相关描述
     */
    private final String description;

    public String getDescription() {
        return description;
    }

    public String getMessage() {
        return message;
    }

    public int getCode() {
        return code;
    }

    ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }
}
